-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add zoom commands #4367
base: master
Are you sure you want to change the base?
Add zoom commands #4367
Conversation
This is awesome and I think this should get added to Vimium. Thank you @chjj for implementing. I think the simplest and least surprising implementation is to make this work the same as Chrome and Firefox's built-in zoom behavior. Chrome's zoom has these properties:
I think the non-linear range of zoom factors is helpful in practice, and presumably someone on the Chrome team thought hard about which specific ones to use. This PR is pretty close to Chrome's implementation already, but for these changes:
What do you think? About key mappings:
[1] Firefox's zoom levels are 30%, 50%, 67%, 80%, 90%, 100%, 120%, 133%, 150%, 170%, 200%, 240%, 300%, 400%, 500%. |
@@ -159,6 +159,14 @@ const mkRepeatCommand = (command) => (function (request) { | |||
} | |||
}); | |||
|
|||
const setZoom = (tabId, callback) => { | |||
chrome.tabs.getZoom(tabId, (factor) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use await for all of these chrome zoom APIs, rather than callbacks.
@philc If you would like, I would be willing to make your suggested changes to see this feature merged, as it appears the original author might not be making them. |
@UncleSnail Yes, that would be great! |
Cool, I'll look into making the changes. How would you like me to submit them, since I can't push directly to this PR? Would you like me to create a new branch/PR? |
Yes
…On Thu, May 30, 2024 at 8:11 AM Caleb Marcoux ***@***.***> wrote:
@UncleSnail <https://github.com/UncleSnail> Yes, that would be great!
Cool, I'll look into making the changes. How would you like me to submit
them, since I can't push directly to this PR? Would you like me to create a
new branch/PR?
—
Reply to this email directly, view it on GitHub
<#4367 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAACDFXMF72WIHISHTEZI7LZE46S5AVCNFSM6AAAAAA7RLX36KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZZHA3TCOBYGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I created a new branch and PR for the suggested changes. #4488 |
Implements zoom commands in a manner similar to cVim (which I recently migrated away from as it seems unmaintained).
The three new commands are
zoomIn
,zoomOut
, andzoomReset
. These are combined with a configurablezoomStep
option which defaults to0.10
(10%).The default key mappings for the above commands are
zi
,zo
, andz0
(cVim defaults) -- may be worth bikeshedding over.Fixes #1866 and #4161 (also see #2978).